package com.atguigu.gmall.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import javax.sound.midi.SoundbankResource;
import java.util.Map;

/**
 * @author: 封捷
 * @create-date: 2022/9/7 14:41
 */
@FeignClient(value = "service-order", fallback = OrderFeignDegradeClient.class)
public interface OrderFeignClient {

    @GetMapping("/api/order/auth/trade")
    Result<Map<String, Object>> trade();

    @GetMapping("/api/order/get/order/info/{orderId}")
    Result<OrderInfo> getOrderInfoById(@PathVariable("orderId") Long orderId);

    @PostMapping("/api/order/submit/sec/kill/order")
    Result<Long> submitSeckillOrder(@RequestBody OrderInfo orderInfo);
}
